package com.ecoolex.ying.space.api.graphql;

import org.springframework.beans.factory.annotation.Autowired;

import com.ecoolex.framework.modularize.api.service.config.SystemConfig;
import com.ecoolex.framework.modularize.api.service.storage.StorageInfo;
import com.ecoolex.framework.modularize.api.service.storage.StorageService;
import com.ecoolex.framework.web.api.graphql2.annotation.GraphQL2Module;
import com.ecoolex.framework.web.api.graphql2.annotation.GraphQL2Module.Type;
import com.ecoolex.framework.web.api.graphql2.annotation.QueryField;
import com.ecoolex.ying.space.Constant;


@GraphQL2Module(type = Type.User, description = "微信客服")
public class WeChatGraphql {

    @Autowired
    private StorageService storageService;
    
    @Autowired
    private SystemConfig systemConfig;

    @QueryField(field = "weChatCustomerServiceImage", description = "微信客服图片")
    public StorageInfo weChatCustomerServiceImage() {
        return storageService.get(systemConfig.get(Constant.CONFIG_WECHAT_CUSTOMER_SERVICE_KEY));
    }
}
